package ch14;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;

class _09_DataInputStreamEx {
	public static void main(String args[]) {

		try {
			FileInputStream fis = new FileInputStream("c:/sample.dat");
			DataInputStream dis = new DataInputStream(fis);

			System.out.println(dis.readInt()); // 10
			System.out.println(dis.readFloat()); // 20.0
			System.out.println(dis.readBoolean()); // true
			dis.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}
}